
//获得角度

//手指接触屏幕

//手指离开屏幕
document.addEventListener("touchend", function(e) {
    var endx, endy;
    endx = e.changedTouches[0].pageX;
    endy = e.changedTouches[0].pageY;
    var direction = getDirection(startx, starty, endx, endy);
    switch (direction) {
        case 0:
            alert("未滑动！");
            break;
        case 1:
            alert("向上！");
            break;
        case 2:
            alert("向下！");
            break;
        case 3:
            alert("向左！");
            break;
        case 4:
            alert("向右！");
            break;
        default:
    }
}, false);
